<?php
    //if(isset($G))
    define('BASEURL', 'http://201php.dev/');
    function __autoload($klasse){
        $bestand = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'klassen'.DIRECTORY_SEPARATOR.$klasse.'.class.php';
        if(file_exists($bestand))
            require_once $bestand;
        else 
            die ('FOUT: klasse'.$klasse.' niet gevonden');
    }
     new Sessie();
     //Sessie::SET('aangemeld', false);
     $padItems = array();
    //$klasse = new Aanmelden();
    if(Sessie::GET('aangemeld')){
        $pad = filter_input(INPUT_GET,'pad',FILTER_SANITIZE_STRIPPED);
        $pad = rtrim($pad,'/');
        if(empty($pad)||$pad =='index.php'){
            $padItems[0]= 'Bestellen';
        }else {
            $padItems = explode('/', $pad);
            if (count($padItems)==0){
                $padItems[0]= 'Bestellen';
            }
        }
    }else{
        $padItems[0]= 'Aanmelden';
    }
$klasseName = $padItems[0];
print_r($padItems);

if(isset($padItems[1])){
    
    $klasse = new $klasseName($padItems[1]);
}else{
    $klasse =new $klasseName();
}
$menu = new Menu();
include 'layout/pagina.php';
?>
